-- Use the Stargate addon to add LS, RD and Wire support to this entity
StarGate.LifeSupportAndWire(ENT)

include("autorun/shared/StargateExtras.lua")

ENT.Type             = "anim"
ENT.Base             = "base_gmodentity"

ENT.PrintName        = "Ori Beam Cannon"
ENT.WireDebugName    = "Ori Beam Cannon"
ENT.Author           = "PyroSpirit"
ENT.Contact		      = "forums.facepunchstudios.com"

ENT.Spawnable        = false
ENT.AdminSpawnable   = false

ENT.AutomaticFrameAdvance = true

ENT.States = {}
ENT.States.IDLE = 1
ENT.States.CHARGING = 2
ENT.States.FIRING = 3
ENT.States.COOLING = 4

function ENT:GetState()
   return self.Entity:GetNetworkedInt("state", self.States.IDLE)
end

function ENT:IsFiring()
   return self:GetState() == self.States.FIRING
end

function ENT:IsCharging()
   return self:GetState() == self.States.CHARGING
end

function ENT:GetEmitterPos()
   return self:GetPos() + (self:GetForward() * self:BoundingRadius()) + self:GetForward()
end

function ENT:GetBeamColour()
   return "220 220 110"
end
